
package com.ami.vmedia.gui;

import com.ami.iusb.IUSBRedirSession;
import com.ami.vmedia.VMApp;
import java.util.TimerTask;
import javax.swing.JTable;

public class UpdateBytesRead extends TimerTask {
	private final int BYTES_READ_COL = 3;

	private IUSBRedirSession iusbRedirSession;

	private JTable statusTable;

	private JTable devStatusTable;

	public void run() {
		this.iusbRedirSession = VMApp.getInstance().getIUSBRedirSession();
		updateReadBytes();
	}

	public void updateReadBytes() {
		this.statusTable = VMApp.getVMPane().getStatusTabPanel().getCDStatusTable().getStatusTable();
		this.devStatusTable = VMApp.getVMPane().getCDStatusTable();
		for (int i = 0; i < VMApp.getInstance().getNumCD(); i++) {
			if ((this.iusbRedirSession.cdromSession[i] != null)
					&& (this.iusbRedirSession.getCDROMRedirStatus(i) == 1)) {
				this.statusTable.setValueAt(this.iusbRedirSession.getCDROMReadBytes(i) + " " + "KB", i, 3);
				this.devStatusTable.setValueAt(this.iusbRedirSession.getCDROMReadBytes(i) + " " + "KB", i, 3);
			}
		}

		this.statusTable = VMApp.getVMPane().getStatusTabPanel().getFDStatusTable().getStatusTable();
		this.devStatusTable = VMApp.getVMPane().getFDStatusTable();
		for (int i = 0; i < VMApp.getInstance().getNumFD(); i++) {
			if ((this.iusbRedirSession.floppySession[i] != null)
					&& (this.iusbRedirSession.getFloppyRedirStatus(i) == 1)) {
				this.statusTable.setValueAt(this.iusbRedirSession.getFloppyReadBytes(i) + " " + "KB", i, 3);
				this.devStatusTable.setValueAt(this.iusbRedirSession.getFloppyReadBytes(i) + " " + "KB", i, 3);
			}
		}

		this.statusTable = VMApp.getVMPane().getStatusTabPanel().getHDStatusTable().getStatusTable();
		this.devStatusTable = VMApp.getVMPane().getHDStatusTable();
		for (int i = 0; i < VMApp.getInstance().getNumHD(); i++) {
			if ((this.iusbRedirSession.hardDiskSession[i] != null)
					&& (this.iusbRedirSession.getHarddiskRedirStatus(i) == 1)) {
				this.statusTable.setValueAt(this.iusbRedirSession.getHarddiskReadBytes(i) + " " + "KB", i, 3);
				this.devStatusTable.setValueAt(this.iusbRedirSession.getHarddiskReadBytes(i) + " " + "KB", i, 3);
			}
		}
	}
}

/*
 * Location:
 * D:\Users\tianlin\Downloads\JViewer.jar!\com\ami\vmedia\gui\UpdateBytesRead.
 * class Java compiler version: 5 (49.0) JD-Core Version: 0.7.1
 */